<?xml version="{{ xml_version | default('1.0') }}" encoding="{{ encoding | default('UTF-8') }}"?>
<ROOT>
    <CLUSTER>
        <PARAM name="clusterName" value="{{ clusterName }}"/>
        <PARAM name="nodeNames" value="{{nodeNames}}"/>
        <PARAM name="gaussdbAppPath" value="{{gaussdbAppPath}}"/>
        <PARAM name="gaussdbLogPath" value="{{gaussdbLogPath}}"/>
        <PARAM name="tmpMppdbPath" value="{{tmpMppdbPath}}"/>
        <PARAM name="gaussdbToolPath" value="{{gaussdbToolPath}}"/>
        <PARAM name="corePath" value="/opt/openGauss/corefile"/>
        <PARAM name="backIp1s" value="{{nodeIps}}"/>
        <PARAM name="clusterType" value="{{clusterType}}"/>
    </CLUSTER>
    <DEVICELIST>
    {% for device in devices %}
    <DEVICE sn="{{ device.sn }}">
        {# 基础参数 #}
        <PARAM name="name" value="{{ device.hostname }}"/>
        <PARAM name="backIp1" value="{{ device.host }}"/>
        <PARAM name="sshIp1" value="{{ device.host }}"/>
        <PARAM name="azName" value="{{ device.az.name }}"/>
        <PARAM name="azPriority" value="{{ device.az.priority }}"/>
        <PARAM name="cmDir" value="{{cmDir}}"/>
        {# 存储配置 #}
        {% if device.role == "primary" %}
        {% if device.component == "hybrid" or device.component == "cms" %}
        <PARAM name="cmsNum" value="{{ cms.num }}"/> 
        <PARAM name="cmServerPortBase" value="{{ cms.cmServerPortBase }}"/> 
        <PARAM name="cmServerListenIp1" value="{{ cms.ListenIp1 }}"/> 
        <PARAM name="cmServerHaIp1" value="{{ cms.HaIp1 }}"/>
        <!-- cmServerLevel目前只支持1, 非1则不启动cmserver -->  
        <PARAM name="cmServerlevel" value="{{ cms.level }}"/> 
        <!-- cms主及所有备的hostname --> 
        <PARAM name="cmServerRelation" value="{{ cms.Relation }}"/> 
        {% endif %}
        {% if device.component == "hybrid" or device.component == "dn" %}
        <PARAM name="dataNum" value="{{datanode.dataNum}}"/>
        <PARAM name="dataPortBase" value="{{ datanode.dataPortBase }}"/>
        <PARAM name="dataPortStandby" value="{{ datanode.dataPortStandby }}"/>
        <PARAM name="dataPortDummyStandby" value="{{ datanode.dataPortDummyStandby }}"/>
        <PARAM name="dataNode1" value="{{datanode.datanodes}}"/>
        {% endif %}
        {% endif %}
    </DEVICE>
    {% endfor %}
    </DEVICELIST>
</ROOT>